<template>
  <h2>count组件</h2>
  {{ count }}
  <button @click="add">+1</button>
</template>

<script>
export default {
  name:'MyCount',
  emits:['GetCount'],
  data(){
    return{
      count:0
    }
  },
  methods:{
    add(){
      this.count++
      this.$emit('GetCount',this.count)
    }
  }
}
</script>

<style>

</style>